﻿@{
    ViewBag.Title = "Listar";
    Layout = "~/Views/Shared/_LayoutAdministrador.cshtml";
}
@model IEnumerable<Cliente_DozenContext.Cliente_CursoProfesor>
<div id="fotolog" style="padding-bottom: 150px;">
    <div id="fondoSup">
        <h1>
            Usuario</h1>
    </div>
    <div id="centercolumnform">
        @{ 
            GridEditMode mode = (GridEditMode)ViewData["mode"];
            GridButtonType type = (GridButtonType)ViewData["type"];  
            
            @(Html.Telerik().Grid(Model)
                    .Name("Grid")
                    .ToolBar(commands => commands.Insert().ButtonType(type).ImageHtmlAttributes(new { style = "margin-left:0" }))
                    .Columns(columns =>
                    {
                        columns.Bound(o => o.Cliente_CursoCod);
                        columns.Bound(o => o.Cliente_Curso.Cliente_CursoNombre);
                        columns.Bound(o => o.Cliente_Profesor.Cliente_ProfesorNombre);
                        columns.Bound(o => o.Cliente_Profesor.Cliente_ProfesorApellidos);
                        columns.Bound(o => o.Cliente_Curso.Cliente_CursoDescripcion);
                        columns.Command(commands =>
                        {
                            commands.Edit();
                            commands.Delete();
                        });
                    })
                    .DataBinding(dataBinding => dataBinding.Server()
                            .Select("Index", "GridCursos", new { mode = mode, type = type })
                            .Insert("Insert", "GridCursos", new { mode = mode, type = type })
                            .Update("Save", "GridCursos", new { mode = mode, type = type })
                            .Delete("Delete", "GridCursos", new { mode = mode, type = type }))
                    .DataKeys(keys => keys.Add(m => m.Cliente_CursoCod))
                    .Scrollable(scrolling => scrolling.Enabled(true))
                    .Pageable(paging => paging.Enabled(true))
                    .Editable(editing => editing.Mode(mode))
                    .Footer(true)
                    .Filterable()
            ) 
            
        }
    </div>
</div>
